package com.mind.adjust.task;

import com.mind.cache.mapper.CacheMapper;
import com.mind.quartz.mapper.SysJobLogMapper;
import jakarta.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * 定时任务调度测试
 *
 * @author adjusting
 */
@Component("adjustTask")
public class AdjustTask {
    @Resource
    private CacheMapper cacheMapper;
    @Resource
    private SysJobLogMapper sysJobLogMapper;

    @Scheduled(fixedDelay = 1000L)
    public void clearCache() {
        cacheMapper.deleteExpiredKeys();
    }

    @Scheduled(cron = "0 0 0 * * *")
    public void clearJobLog() {
        sysJobLogMapper.clearJobLog(7);
    }
}
